import lejos.nxt.Button;

public class ButtonListener extends Thread{
	
	public ButtonListener() {
	}
	
	public void run() {
		while(true){
			try {
				Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			if(Button.ESCAPE.isPressed()) {
				System.exit(0);
			}
		}
	}
}